-
Notifications
You must be signed in to change notification settings - Fork 2k
Дипломная работа первая часть #1164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
.idea/.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Папку .idea не нужно было загружать в репозиторий. Эта папка должна быть добавлена в .gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено.
|
|
||
| @RunWith(Parameterized.class) | ||
| public class BunTest { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Тестируем только класс Burger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено, класс удален.
| String receipt = burger.getReceipt(); | ||
|
|
||
| assertNotNull("Чек не должен быть null", receipt); | ||
| assertTrue("Чек должен содержать название булочки", receipt.contains(bunName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Для юнит-тестов придерживаемся подхода: один тест, значит одна проверка. Если очень хочется несколько проверок -- тогда используем softAssertions. Поправь, пожалуйста, во всем коде
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено в двух тестовых классах.
|
|
||
| assertNotNull("Чек не должен быть null", receipt); | ||
| assertTrue("Чек должен содержать название булочки", receipt.contains(bunName)); | ||
| assertTrue("Чек должен содержать название ингредиента", receipt.contains(ingredientName.toLowerCase())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Строку рецепта проверяем целиком, чтобы не пропустить ошибки форматирования
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не исправлено
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено. Проблема в том, что решая конфликты с Гитом, по ошибке откатил коммиты на один из предыдущих и отправил на проверку старую версию! В новой этот вопрос решен.
target/classes/praktikum/Bun.class
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. В папке target оставляем только отчет, остальные файлы нужно удалить из пулл реквеста
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Файлы отчета оставлены в папке таргет, остальные удалены.
- Use updated BurgerReceiptTest with full receipt validation - Use updated BurgerTest with single assertion principle - Remove BunTest as not required by specification - Add .gitignore for proper file exclusion - Keep local README.md version
- Remove target/ folder (build artifacts) - Remove .idea/ folder (IDE settings) - Keep only source code and configuration files
|
|
||
| String receipt = burger.getReceipt(); | ||
|
|
||
| assertNotNull("Чек не должен быть null", receipt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Для юнит-тестов придерживаемся подхода: один тест, значит одна проверка. Если очень хочется несколько проверок -- тогда используем softAssertions. Поправь, пожалуйста, во всем коде
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено. Отправил старую версию по ошибке.
|
|
||
| assertNotNull("Чек не должен быть null", receipt); | ||
| assertTrue("Чек должен содержать название булочки", receipt.contains(bunName)); | ||
| assertTrue("Чек должен содержать название ингредиента", receipt.contains(ingredientName.toLowerCase())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не исправлено
| burger.addIngredient(ingredient2); | ||
| burger.removeIngredient(0); | ||
|
|
||
| assertEquals("Должен остаться один ингредиент после удаления", 1, burger.ingredients.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Для юнит-тестов придерживаемся подхода: один тест, значит одна проверка. Если очень хочется несколько проверок -- тогда используем softAssertions. Поправь, пожалуйста, во всем коде
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено в актуальной версии.
| @Test | ||
| public void testMoveIngredient() { | ||
| Burger burger = new Burger(); | ||
| Ingredient ingredient1 = new Ingredient(ingredientType, ingredientName, ingredientPrice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. При нейминге не рекомендуется использовать числа (Field2), их еще называют magicNumbers. Очень тяжело поддерживать код с magicNumbers.
| public void testMoveIngredient() { | ||
| Burger burger = new Burger(); | ||
| Ingredient ingredient1 = new Ingredient(ingredientType, ingredientName, ingredientPrice); | ||
| Ingredient ingredient2 = new Ingredient(IngredientType.FILLING, "сосиска", 300f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Нужно использовать моки
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделано.
src/test/java/BurgerReceiptTest.java
Outdated
| assertNotNull("Чек не должен быть null", receipt); | ||
| assertTrue("Чек должен содержать название булочки", receipt.contains(bunName)); | ||
| assertTrue("Чек должен содержать название ингредиента", receipt.contains(ingredientName.toLowerCase())); | ||
| assertTrue("Чек должен содержать цену", receipt.contains("Price:")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Тесты дважды в разных пакетах лежат
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрал лишние папки из коммита. Мусор оказался там, когда решал конфликты с гитом и откатил не на ту версию.
src/test/java/BurgerTest.java
Outdated
| @Test | ||
| public void testAddIngredient() { | ||
| Burger burger = new Burger(); | ||
| Ingredient ingredient = new Ingredient(ingredientType, ingredientName, ingredientPrice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Нужно моки использовать
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделано.
src/test/java/BurgerTest.java
Outdated
| @Test | ||
| public void testRemoveIngredient() { | ||
| Burger burger = new Burger(); | ||
| Ingredient ingredient1 = new Ingredient(ingredientType, ingredientName, ingredientPrice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Для юнит-тестов придерживаемся подхода: один тест, значит одна проверка. Если очень хочется несколько проверок -- тогда используем softAssertions. Поправь, пожалуйста, во всем коде
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделано.
src/test/java/BurgerTest.java
Outdated
|
|
||
| @Test | ||
| public void testMoveIngredient() { | ||
| Burger burger = new Burger(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Нужна ли в этих тестах параметризация ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Оставил только там, где она необходима.
src/test/java/BurgerTest.java
Outdated
| assertNotNull("Булочка должна быть выбрана", burger.bun); | ||
| assertEquals("Булочка должна совпадать", bun, burger.bun); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Нет отчёта о тестировании
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отчет в папке таргет, остальные файлы из коммита убрал.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Нужно приложить все файлы из папки jacoco
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ОК. Сделано.
No description provided.